home *** CD-ROM | disk | FTP | other *** search
/ Megahits 3 / Megahits 3 (1994)(GTI - Rhein-Main-Soft)(DE)[!].iso / module / moremods / 8bhours.mod < prev    next >
Text File  |  1994-10-14  |  3KB  |  71 lines

  1. modifies ! parameter in callout.net
  2. Eight Ball #1 @6913 [Sub-board Host]
  3. 12/08/91  21:07:59 - Princeton, New Jersey
  4. /*
  5.  * Eight Ball's Mod #44: Changes action of ! CALLOUT.NET parameter (see below)
  6.  * 8BHOURS.MOD - Another [DSS] Presentation - 11/24/91
  7.  */
  8.  
  9. I finally crawled out of the hole they call college and wrote another mod.
  10. The idea had been floating around my head for a while, and it didn't seem like
  11. it would take all that long, and I needed a study break anyway.
  12.  
  13. This mod should work with 4.20, but it was developed on 4.12.  As usual, I make
  14. no guarantees about this mod so if it causes your system to call LD once every
  15. 5 minutes, I'm not going to be held responsible for it.  Back up your source
  16. first.
  17.  
  18. The way the ! parameter currently works is: If you have the !x parameter in
  19. the line for some node in your CALLOUT.NET, your node will try to call out
  20. once every 20/x hours (x has to be an integer) or just once every 20 hours if
  21. you omit the x and just put !.
  22.  
  23. This always seemed counter-intuitive to me.  With this mod, the !x parameter
  24. makes it call out once every x hours, which is more straightforward.
  25.  
  26. First, backup your source files.  (Usual disclaimer here)
  27.  
  28. File: CONNECT1.C
  29. Function: void read_call_out_list()
  30.  
  31. modify the line marked /*%%*/ as directed.  Lines marked with /*==*/ are
  32. already there, and are included here to aid you in locating the proper section
  33. of code.
  34.  
  35. /*==*/ case '!':
  36. /*==*/   con[cur_sys].options |= options_once_per_day;
  37. /*==*/   ++p;
  38. /*==*/   con[cur_sys].times_per_day=atoi(&(ss[p]));
  39. /*==*/   if (!con[cur_sys].times_per_day)
  40. /*%%*/     con[cur_sys].times_per_day=1;  /* change 1 to 20 */
  41. /*==*/   break;
  42.  
  43. This makes it so that if you just have ! it will only call out once every 20
  44. hours, so nothing will have changed.
  45.  
  46. File: NETSUP.C
  47. Function: void attempt_callout()
  48.  
  49. Delete the line marked with /*--*/ and replace it with the line marked /*++*/
  50. (or you can just modify the line marked with /*--*/ until it looks like the
  51. line marked with /*++*/)
  52.  
  53. /*==*/ if (con[i].options & options_once_per_day) {
  54. /*--*/   if (labs(l-ncn[i2].lastcontactsent)<(20L*3600L/con[i].times_per_day))
  55. /*++*/   if (labs(l-ncn[i2].lastcontactsent)<(3600L*(long)con[i].times_per_day))
  56. /*==*/     ok=0;
  57. /*==*/ }
  58.  
  59. Gosh, wasn't that simple?
  60.  
  61. We're not quite done yet.  Now you have to edit your CALLOUT.NET and change
  62. all the !x parameters to be the way you want them to be.  If you had !2, that
  63. meant it would only try to call out once every 20/2=10 hours so you should
  64. change !2 to !10 now, and so on.
  65.  
  66. Also, remember in the future that even though it says times_per_day, that
  67. number actually shows the number of hours to wait between calls.  So don't
  68. get confused when you look at the code later.
  69.  
  70. -8b [DSS]
  71.  11/24/91